﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Linq;

namespace WPFRadio
{
    public class XmlParser
    {
       
        public static List<Category> ParseXMLGenre(Stream stream)
        {
            List<Category> List = new List<Category>();
         
        
            XDocument xDoc = XDocument.Load("genrelist.xml");
            var query = xDoc.Element("genrelist")
                             .Elements("genre")
                             .Attributes("name");
            foreach (XAttribute resutl in query)
            {
                
                List.Add(new Category(resutl.Value));

            }

            return List;
                     
                            

                            


          
                                        
            

        }
    }
}
